package com.fantsey.di.business;

import com.fantsey.di.pojo.User;
import com.fantsey.di.service.PlayService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author fx
 * @date 2024/7/26
 * @since 1.0
 */
@Service
@Slf4j
public class UserService {

    private User user;


    // DI注入三种方式

    // 1. Filed Injection 属性注入
//    @Autowired
//    @Qualifier("mp4Player")
    @Resource
    private PlayService playService;


    // 2. Setter Injection setter注入
//    private PlayService playService;
//
//    @Autowired
//    public void setPlayService(PlayService playService) {
//        this.playService = playService;
//    }


    // 3. Constructor Injection 构造器注入
//    private PlayService playService;
//    UserService(PlayService playService) {
//        this.playService = playService;
//    }


}
